import 'package:flutter/material.dart';
import 'package:get/get.dart';

class Toast extends StatelessWidget {
  final String msg;

  const Toast({super.key, required this.msg});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        constraints: BoxConstraints(
            minWidth: 120,
            minHeight: 120,
            maxWidth: Get.width,
            maxHeight: Get.height),
        padding: EdgeInsets.all(12),
        margin: EdgeInsets.symmetric(vertical: 60, horizontal: 40),
        decoration: BoxDecoration(
          color: Colors.black54,
          borderRadius: BorderRadius.circular(12),
        ),
        child: IntrinsicWidth(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                "$msg",
                style: TextStyle(fontSize: 16, color: Colors.white),
              ).marginOnly(top: 12)
            ],
          ),
        ),
      ),
    );
  }
}
